package com.itheima.mapper;

import com.itheima.domain.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {

    @Select("select * from t_student where id =#{id}")
    Student findById(Integer id);


    @Select("select * from t_student ")
    List<Student> findAll();


    @Insert("insert into t_student values (#{id},#{name},#{sex},#{age},#{address})")
    void save(Student student);


    void delete(List<Integer> ids);

    @Update("update t_student set name=#{name} ,sex=#{sex},age=#{age},address=#{address} where id =#{id}")
    void update(Student student);
}
